package arena.iterator;

import java.util.List;

import arena.soldier.ArmedUnit;

public class ArmedUnitSquadIterator implements Iterator {

	private List<ArmedUnit> armedUnitList;
	private int nge;
	  
	public ArmedUnitSquadIterator( List<ArmedUnit> armedUnitList ) {
	   this.armedUnitList = armedUnitList;
	   nge = 0;
	}
	
	@Override
	public ArmedUnit getNextElement() {
		 if ( nge >= armedUnitList.size() ) return null;
		   return armedUnitList.get(nge++);
	}
	
	public void reset() {
		nge=0;
	}

	@Override
	public ArmedUnit getCurrentElement() {
		return armedUnitList.get(nge);
	}

}
